package list.trst.Demo2;

public class TestSwim {
    public static void main(String[] args) {
        new Swim(){
            @Override
            public void swimming() {
                System.out.println("迪迦游泳被水呛死");
            }
        }.swimming();


        goSwimming(new Swim() {
            @Override
            public void swimming() {
                System.out.println("大灰狼和小红帽结婚");
            }
        });

        MyInter i =new MyInter();
        i.swimming();

    }
    public static void goSwimming(Swim s){  //Swim s = new Swim();
        s.swimming();
    }
}
